package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.LeadDaoImpl;
import com.asset.salesforce.domain.Lead;

@Service
@Transactional(readOnly = true)
public class LeadService {
	@Autowired
	private LeadDaoImpl daoImpl;
	
	public List<Lead> getLeads(Integer ownerId ) {
		return daoImpl.getLead(ownerId);
	}
	@Transactional(readOnly = false)
	public Lead addLead(Lead lead){
		return daoImpl.addLead(lead);
	}
	@Transactional(readOnly = true)
	public Lead getLeadById(Integer Id ) {
		return daoImpl.getLeadById(Id);
	}
	@Transactional(readOnly = false)
	public void saveOrupdate(Lead lead){
		daoImpl.saveOrupdate(lead);
	}
	public Lead loadLead(Integer id) {
		return daoImpl.loadLead(id);
	}
	@Transactional(readOnly = false)
	public void deleteLead(Lead lead) {
		daoImpl.deleteLead(lead);
	}
	@Transactional(readOnly = true)
	public List<String> getViewLeads(List<String> fields, List<String> cols, List<String> operators, List<String> values, String fromDomain, String reportPeriod) {
		return daoImpl.getViewLeads(fields, cols, operators, values, fromDomain, reportPeriod);
	}
	@Transactional(readOnly = true)
	public List<String> getViewCustomDate(List<String> fields, List<String> cols, List<String> operators, List<String> values, String fromDomain, String startDate, String endDate) {
		return daoImpl.getViewCustomDate(fields, cols, operators, values, fromDomain, startDate, endDate);
	}
	@Transactional(readOnly = true)
	public List<Lead> getAllLead(Integer index,Integer companyId,Integer count) {
		return daoImpl.getAllLead(index,companyId,count);
	}
	@Transactional(readOnly = true)
	public Integer getAllLeadSize(Integer companyId) {
		return daoImpl.getAllLeadSize(companyId);
	}
	@Transactional(readOnly=true)
	public Lead getLeadByEmpId(Integer empId){
		return daoImpl.getLeadByEmpId(empId);
	}
}
